package com.example.mapp.buildSql;

import com.example.entity.CustomReport;

/**
 * 监管场所自定义查询导出
 */
public class CustomReportMappSql {
    /**
     * findList
     * @param
     * @return
     */
    public String findlists(CustomReport customReport){
        StringBuffer sb = new StringBuffer();
        sb.append(" select ");
        sb.append("  id AS id, ");
        sb.append("  report_name AS 'reportName', ");
        sb.append("  is_null_parm AS 'isNullParm', ");
        sb.append("  sql_sentence AS 'sqlSentence', ");
        sb.append("  create_by AS 'createBy', ");
        sb.append("  create_date AS 'createDate', ");
        sb.append("  update_by AS 'updateBy', ");
        sb.append("  update_date AS 'updateDate',");
        sb.append("  del_flag AS 'delFlag' ");
        sb.append("  from custom_report  where del_flag='1' ");
        if(customReport.getId() !=null){
            sb.append(" and id="+customReport.getId()+"");
        }
        return sb.toString();
    }
}
